﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using IHISCETeim.BLL;
using IHISCETeim.Library;
using IHISCETeim.Model;
using System.Text;
using System.IO;
using System.Web.UI.HtmlControls;
using System.Data;
using System.Collections;

namespace IHISCETeim.Web.MachineSys.MacModel
{
    public partial class ExeclOInspectionData : PageBase
    {
        protected override Permission[] PowerKey
        {
            get
            {
                return new Permission[] { Permission.导出 };
            }
        }
        protected override string DWZRef
        {
            get
            {
                return "OInspectionList";
            }
        }
        #region 属性 (查询条件)

        protected override string orderField
        {
            get
            {
                return string.IsNullOrEmpty(base.orderField) ? "SerialNumber" : base.orderField;
            }
        }
        protected override string orderDirection
        {
            get
            {
                return string.IsNullOrEmpty(base.orderDirection) ? "Desc" : base.orderDirection;
            }
        }

        protected string MachineType
        {
            get
            {
                return GetRequestValue<string>("MachineType", "");

            }
        }
        protected string SerialNumber
        {
            get
            {
                return GetRequestValue<string>("SerialNumber", "");

            }
        }
        protected string DownlineDateFrom
        {
            get
            {
                return GetRequestValue<string>("DownlineDateFrom", "");

            }
        }
        protected string DownlineDateTo
        {
            get
            {
                return GetRequestValue<string>("DownlineDateTo", "");

            }
        }
        protected string DJNGItemCode
        {
            get
            {
                return GetRequestValue<string>("DJNGItemCode", "");

            }
        }
        protected string BZNGItemCode
        {
            get
            {
                return GetRequestValue<string>("BZNGItemCode", "");

            }
        }



        #endregion

        protected void Page_Load(object sender, EventArgs e)
        {          
            DataBind("完检单导出"+DateTime.Now.ToShortDateString());
        }
    
        protected void DataBind(string filename)
        {
            GridView1.DataSource = OInspectionController.GetExeclDate(MachineType, SerialNumber, DownlineDateFrom, DownlineDateTo, DJNGItemCode);
            GridView1.DataBind();
            base.ExportToExecl(filename, GridView1);           
        }
    }
}